<?php
//xna wap
DEFINE("_ROOT","../");
require_once(_ROOT . 'global.php');
$id= is_numeric( $_GET[id ])  ? $_GET[id] : "";
if(!empty($id)){
$query = $db->query("SELECT * FROM {$tablepre}xna_feed WHERE state!='0' and feedid=$id limit 1");
}else{	
	$tatol = $stats['feed_count'];					
	$pageurl = 'index.php';
	$pagenum = 10;	
		if($page) {
			$start_limit = ($page - 1) * $pagenum;
		} else {
			$start_limit = 0;
			$page = 1;
		}
	$query = $db->query("SELECT *  FROM {$tablepre}xna_feed WHERE state!=0 $arg order by $hots state desc,addtime desc LIMIT $start_limit,$pagenum");	
	$multipage = multi($tatol, $pagenum, $page, $pageurl);	
}
	while ($row=$db->row($query)){
		$row[id] = $row["feedid"];
	    $row[title] = $row["feed_title"];
	    $row[content] = clearHtml($row["content"]);
	    $row[addtime] = date("Y-m-d H:m:s",$row["addtime"]);
	    $n++;
	    $feed[] = $row;
	}

header("Content-type: text/vnd.wap.wml; charset=utf-8");
include template("wap", _ROOT ."/template/digg/");
?>